<%--
  Created by IntelliJ IDEA.
  User: Jerry
  Date: 2019/10/3
  Time: 20:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style type="text/css">
        tr td{text-align: center}
    </style>
</head>
<body>
    <div align="center">
        <h1>工作笔记</h1>
        <a href="addInfo.jsp">添加笔记</a>
        <table border="1" width="40%" id="border">
            <tr>
                <th>笔记标题</th>
                <th>笔记分类</th>
                <th>编写时间</th>
                <th>操作</th>
            </tr>
            <c:forEach var="working" items="${list}" varStatus="status">
                <!-- 如果是奇数行，为改行换背景颜色 -->
                <tr <c:if test="${status.index % 2 == 1 }">
                    style="background-color:rgb(219,241,212);"
                </c:if>>
                    <td>${working.title}</td>
                    <td>
                        <c:if test="${working.type  == 1}">技术</c:if>
                        <c:if test="${working.type  == 2}">行政</c:if>
                        <c:if test="${working.type  == 3}">人事</c:if>
                    </td>
                    <td>${working.createDate}</td>
                    <td><a href="ShowInfoServlet?id=${working.id}">查看</a></td>
                </tr>
            </c:forEach>
        </table>
    </div>
</body>
</html>
